package com.blog.Utils;

/**
 * @author 任浩
 * @version 1.0
 */
public class ThreadLocalUtils {

    private static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    /**
     * 设置验证码数据
     * @param text
     */
    public static void setValid(String text){
        threadLocal.set(text);
    }

    /**
     * 返回验证码信息
     * @return
     */
    public static String getVaild(){
        return threadLocal.get();
    }

    /**
     * 删除验证码信息
     */
    public static void removeVaild(){
        threadLocal.remove();
    }

}
